import * as types from '@/redux/mutation-types';

// 设置路由权限
export const setAuthRouter = (authRouter: string[]) => {
  return {
    type: types.SET_AUTH_ROUTER,
    authRouter,
  };
};

// 设置按钮权限
/*
  按钮权限格式：
  [
    {
      “sys/home”: ["add", "delete"]
    }
  ]
*/
export const setAuthButton = (authButton: { [propName: string]: any }) => {
  return {
    type: types.SET_AUTH_BUTTON,
    authButton,
  };
};
